﻿using Developer.Core.FrameWork.HelpFile;

namespace Developer.Core.FrameWork.GlobalVar
{
    /// <summary>
    /// 全局变量
    /// </summary>
    public class GlobalVars
    {
        // httpclient 名称
        public static string HttpName = "MicroService";

        // 是否开启IP限流
        public static bool IsIPLimit = Appsettings.app("MiddleWare", "IPLimit", "Enable").ObjToBool();

        // 是否开启IP请求记录日志
        public static bool IsIPLog = Appsettings.app("MiddleWare", "IPRecord", "Enable").ObjToBool();

        // 是否开启负载均衡
        public static bool LoadBalance = Appsettings.app("MiddleWare", "LoadBalance", "Enable").ObjToBool();

        // 是否开启事件总线
        public static bool EventBus = Appsettings.app("MiddleWare", "EventBus", "Enable").ObjToBool();

        // 是否开启RabbitMQ
        public static bool RabbitMQ = Appsettings.app("MiddleWare", "RabbitMq", "Enable").ObjToBool();

        // 是否开启Polly
        public static bool Polly = Appsettings.app("MiddleWare", "Polly", "Enabled").ObjToBool();

        // 是否开启RedisMQ
        public static bool RedisMQ = Appsettings.app("MiddleWare", "RedisMq", "Enabled").ObjToBool();

        // 是否开启Consul服务发现
        public static bool ConsulDiscovery = Appsettings.app("MiddleWare", "ConsulDiscovery", "Enabled").ObjToBool();

        // 是否开启Consul服务注册
        public static bool ConsulRegister = Appsettings.app("MiddleWare", "ConsulRegister", "Enabled").ObjToBool();

        // Redis消息队列key
        public const string RedisKey = "DeveloperRedisKey";
    }
}
